package com.mworld.galaxy.bull.repository.product;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.mworld.galaxy.bull.entity.product.Shop;

public interface ShopDao extends PagingAndSortingRepository<Shop, Long>, JpaSpecificationExecutor<Shop> {
    Shop findByName(String name);
    Shop findByDomainName(String domainName);

    @Modifying
    @Query("update Shop shop set shop.status = ?2 where shop.id = ?1")
    void changeStatus(Long id, int status);
}
